# 测试登录API
$uri = "http://10.1.200.169:6724/api/Auth/login"
$body = @{
    Username = "admin"
    Password = "Admin@666"
} | ConvertTo-Json

$headers = @{
    "Content-Type" = "application/json"
}

try {
    Write-Host "正在测试登录API: $uri"
    Write-Host "请求体: $body"
    
    $response = Invoke-RestMethod -Uri $uri -Method POST -Body $body -Headers $headers
    Write-Host "登录成功!"
    Write-Host "响应: $($response | ConvertTo-Json -Depth 3)"
} catch {
    Write-Host "登录失败!"
    Write-Host "错误信息: $($_.Exception.Message)"
    if ($_.Exception.Response) {
        Write-Host "HTTP状态码: $($_.Exception.Response.StatusCode)"
        Write-Host "状态描述: $($_.Exception.Response.StatusDescription)"
    }
}